package servlets;
import java.io.IOException;
import java.sql.Connection;
import java.sql.Statement;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.mongodb.Mongo;

import database.DatabaseOperations;

public class DeleteJob extends HttpServlet {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	

	public void doPost(HttpServletRequest req, HttpServletResponse res)
			throws ServletException, IOException {
		
		DatabaseOperations databaseOperations = new DatabaseOperations();
		try {
			int orderId = Integer.parseInt(req.getParameter("orderId"));
			databaseOperations.deleteJob(orderId);
		} finally {
			databaseOperations.closeConnection();
		}
		
	}
}
